<template>
    <div class="app-container">
        <el-form :model="goodsBuy" ref="goodsBuy"  label-width="120px">
              <el-row>
                <el-col :span="12">
                    <el-form-item label="物品名称" prop="goodsName">
                        <el-input v-model="goodsBuy.goodsName" :disabled="true"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="物品数量" prop="buyCount">
                        <el-input-number v-model="goodsBuy.buyCount"  :min="1" :max="100" label="描述文字" :disabled="true"></el-input-number>
                    </el-form-item>
                </el-col>
              </el-row>
              <el-form-item label="物品用途" prop="purpose">
                  <el-input v-model="goodsBuy.purpose" type="textarea" :disabled="true"></el-input>
              </el-form-item>
              <el-row>
                <el-col :span="12">
                    <el-form-item label="部门" prop="deptIds">
                      {{goodsBuy.deptName}}
                    </el-form-item>
                </el-col>
                <el-col :span="12" >
                    <el-form-item label="抄送人" prop="ccUsers">
                        <el-tag v-for="item in goodsBuy.ccUserList" :key="item.id" style="margin-left: 3px;">{{item.userName}}</el-tag>
                    </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="12">
                    <el-form-item label="提交人" prop="goodsName">
                        {{goodsBuy.createBy}}
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="提交时间" prop="buyCount">
                        {{parseTime(goodsBuy.createTime)}}
                    </el-form-item>
                </el-col>
              </el-row>
              
              
          </el-form>
    </div>
  </template>
  
  <script>
  import { treeselectAll } from "@/api/system/dept";
  
  export default {
    name: "leaveApplyDetail",
    props:{
        goodsBuy: Object,
      isShowLeave: Boolean
    },
    data() {
      return {
          leaveTypeList:[],
          props:{multiple: true},
          deptOptions:[]
      };
    },
  
    created() {
      this.getDicts("leave_type").then(response => {
        this.leaveTypeList = response.data;
      });
      this.getTreeselect()
      
    },
    methods: {
      handlePreview(file){
          this.preFile(file.url)
      },
      preFile(fileName){
        window.open(process.env.VUE_APP_BASE_API + "/school/file/" +fileName)
      },
      getTreeselect() {
          treeselectAll().then(response => {
              this.deptOptions = response.data;
          });
      },
      
    }
  };
  </script>
  